\hypertarget{ds1307_8c}{
\section{front\_\-panel/ds1307.c File Reference}
\label{ds1307_8c}\index{front\_\-panel/ds1307.c@{front\_\-panel/ds1307.c}}
}
Main file of the front panel.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$avr/interrupt.h$>$}\par
{\tt \#include \char`\"{}ds1307.h\char`\"{}}\par
{\tt \#include \char`\"{}../i2c.h\char`\"{}}\par
{\tt \#include \char`\"{}../delay.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{ds1307_8c_727dda1535d27c79c72e3336ece957fb}{
void \hyperlink{ds1307_8c_727dda1535d27c79c72e3336ece957fb}{ds1307\_\-init} (void)}
\label{ds1307_8c_727dda1535d27c79c72e3336ece957fb}

\begin{CompactList}\small\item\em Initialize the realtime clock on the front panel. \item\end{CompactList}\item 
void \hyperlink{ds1307_8c_7e8d2814050d1e975ac7db2b1a193efb}{ds1307\_\-set\_\-time} (char $\ast$data)
\begin{CompactList}\small\item\em Set the current time of the realtime clock. \item\end{CompactList}\item 
unsigned char \hyperlink{ds1307_8c_752ce1f327a2904eab83f4f2ee3084af}{ds1307\_\-get\_\-hours} (void)
\begin{CompactList}\small\item\em Retrieve the hour part of the time from the realtime clock. \item\end{CompactList}\item 
unsigned char \hyperlink{ds1307_8c_396954cf810dffac46a03edd5c8bffda}{ds1307\_\-get\_\-minutes} (void)
\begin{CompactList}\small\item\em Retrieve the minute part of the time from the realtime clock. \item\end{CompactList}\item 
unsigned char \hyperlink{ds1307_8c_2ab86688ef79268cc90c4d592de9e535}{ds1307\_\-get\_\-seconds} (void)
\begin{CompactList}\small\item\em Retrieve the seconds part of the time from the realtime clock. \item\end{CompactList}\item 
\hypertarget{ds1307_8c_767948ce3f17b036524fc8c0f00ac0d9}{
void \hyperlink{ds1307_8c_767948ce3f17b036524fc8c0f00ac0d9}{ds1307\_\-read} (void)}
\label{ds1307_8c_767948ce3f17b036524fc8c0f00ac0d9}

\begin{CompactList}\small\item\em Read the current time/date from the realtime clock. Stores the data and can be retrieved with the get functions in this file. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{ds1307_8c_6d274b9695c36c77e6692ddc3bbc349b}{
unsigned char \hyperlink{ds1307_8c_6d274b9695c36c77e6692ddc3bbc349b}{allowed\_\-to\_\-read} = 0}
\label{ds1307_8c_6d274b9695c36c77e6692ddc3bbc349b}

\begin{CompactList}\small\item\em Flag which is set to 1 if a read request is allowed to the ds1307. \item\end{CompactList}\item 
\hypertarget{ds1307_8c_bd68a1b487cf2c0b7c6bf26ac314b47e}{
unsigned char $\ast$ \hyperlink{ds1307_8c_bd68a1b487cf2c0b7c6bf26ac314b47e}{time\_\-data}}
\label{ds1307_8c_bd68a1b487cf2c0b7c6bf26ac314b47e}

\begin{CompactList}\small\item\em Variable which contains information of the current time/date. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Main file of the front panel. 

Realtime clock.

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2008-04-30 /$\ast$!\end{Desc}
\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "front_panel/ds1307.c" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{ds1307_8c-source}{ds1307.c}.

\subsection{Function Documentation}
\hypertarget{ds1307_8c_752ce1f327a2904eab83f4f2ee3084af}{
\index{ds1307.c@{ds1307.c}!ds1307\_\-get\_\-hours@{ds1307\_\-get\_\-hours}}
\index{ds1307\_\-get\_\-hours@{ds1307\_\-get\_\-hours}!ds1307.c@{ds1307.c}}
\subsubsection[{ds1307\_\-get\_\-hours}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char ds1307\_\-get\_\-hours (void)}}
\label{ds1307_8c_752ce1f327a2904eab83f4f2ee3084af}


Retrieve the hour part of the time from the realtime clock. 

\begin{Desc}
\item[Returns:]The current hour \end{Desc}


Definition at line 85 of file ds1307.c.

Referenced by display\_\-update\_\-screensaver().\hypertarget{ds1307_8c_396954cf810dffac46a03edd5c8bffda}{
\index{ds1307.c@{ds1307.c}!ds1307\_\-get\_\-minutes@{ds1307\_\-get\_\-minutes}}
\index{ds1307\_\-get\_\-minutes@{ds1307\_\-get\_\-minutes}!ds1307.c@{ds1307.c}}
\subsubsection[{ds1307\_\-get\_\-minutes}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char ds1307\_\-get\_\-minutes (void)}}
\label{ds1307_8c_396954cf810dffac46a03edd5c8bffda}


Retrieve the minute part of the time from the realtime clock. 

\begin{Desc}
\item[Returns:]The current minute \end{Desc}


Definition at line 93 of file ds1307.c.

Referenced by display\_\-update\_\-screensaver().\hypertarget{ds1307_8c_2ab86688ef79268cc90c4d592de9e535}{
\index{ds1307.c@{ds1307.c}!ds1307\_\-get\_\-seconds@{ds1307\_\-get\_\-seconds}}
\index{ds1307\_\-get\_\-seconds@{ds1307\_\-get\_\-seconds}!ds1307.c@{ds1307.c}}
\subsubsection[{ds1307\_\-get\_\-seconds}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char ds1307\_\-get\_\-seconds (void)}}
\label{ds1307_8c_2ab86688ef79268cc90c4d592de9e535}


Retrieve the seconds part of the time from the realtime clock. 

\begin{Desc}
\item[Returns:]The current seconds \end{Desc}


Definition at line 101 of file ds1307.c.

Referenced by display\_\-update\_\-screensaver().\hypertarget{ds1307_8c_7e8d2814050d1e975ac7db2b1a193efb}{
\index{ds1307.c@{ds1307.c}!ds1307\_\-set\_\-time@{ds1307\_\-set\_\-time}}
\index{ds1307\_\-set\_\-time@{ds1307\_\-set\_\-time}!ds1307.c@{ds1307.c}}
\subsubsection[{ds1307\_\-set\_\-time}]{\setlength{\rightskip}{0pt plus 5cm}void ds1307\_\-set\_\-time (char $\ast$ {\em data})}}
\label{ds1307_8c_7e8d2814050d1e975ac7db2b1a193efb}


Set the current time of the realtime clock. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]data\mbox{[}0\mbox{]} = seconds, data\mbox{[}1\mbox{]} = minutes, data\mbox{[}2\mbox{]} = hours, data\mbox{[}3\mbox{]} = Day, data\mbox{[}4\mbox{]} = Date, data\mbox{[}5\mbox{]} = month, data\mbox{[}6\mbox{]} = year \end{description}
\end{Desc}


Definition at line 62 of file ds1307.c.

Referenced by computer\_\-interface\_\-parse\_\-data().